Skip to content

Fix: add missing enable_tensor_type for CartesianLeviCivitaTensor and fix Levi-Civita size() #578#579

Merged
EmilyBourne merged 8 commits into
gyselax:develfrom
Quntized:fix/static-tensors-improvement
Mar 17, 2026
Merged

Fix: add missing enable_tensor_type for CartesianLeviCivitaTensor and fix Levi-Civita size() #578#579
EmilyBourne merged 8 commits into
gyselax:develfrom
Quntized:fix/static-tensors-improvement

Conversation

@Quntized

@Quntized Quntized commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

src/coord_transformations/static_tensors.hpp:

  1. Bug fix: Add missing enable_tensor_type specialization for
    CartesianLeviCivitaTensor.

  2. Bug fix: Fix size() in both CartesianLeviCivitaTensor and
    LeviCivitaTensor. The previous implementation returned rank() * rank()
    for just rank = 2;

  3. Improvement: Use ddc::type_seq_element_t<dim, index_set> for
    IdentityTensor::vector_index_set_t,

  4. Improvement: Use ElementType instead of hardcoded double as the
    return type of ddcHelper::get overloads for special tensors.

  5. Doc fix: Correct ddcHelper::get doc comments
    "modifiable reference" when the functions return by value.


Please complete the checklist to ensure that all tasks are completed before marking your pull request as ready for review.

All Submissions

  • Have you ensured that all lines changed in this PR are justified by a comment found in the description ?
  • Have you updated the CHANGELOG.md ?
  • Have you linked any issues that should be closed when this PR is merged (using closing keywords) ?
  • Have you checked that the AUTHORS file is up to date ?
  • Have you checked that the copyright information in the LICENCE file is up to date (including dates) ?
  • Do you follow the conventions specified in our coding standards ?

New Feature Submissions

  • Have you added tests for the new functionalities ?
  • Have you documented the new functionalities:
    • API documentation describing the available methods, when each should be used and how to use them ?
    • User-friendly documentation in README files (which may link to the API documentation).
    • If the new functionality is non-trivial to use, provide a tutorial or example ? (optional)

Changes to Existing Features

  • Have you checked that existing tests cover all code after the changes ?
  • Have you checked that existing tests are still passing ?
  • Have you checked that the existing documentation is still accurate (API and README files) ?

Changes to the CI

  • Have you made the same changes to both the GitHub CI and the GitLab CI (for the private fork) ?

@EmilyBourne EmilyBourne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, but I think at least one extra test would be nice. To tests a different ElementType and maybe to show why CartesianLeviCivitaTensor needs to be enabled as a tensor type

Comment thread src/data_types/static_tensors.hpp Outdated
@Quntized Quntized force-pushed the fix/static-tensors-improvement branch 3 times, most recently from e7ee10e to ab6925c Compare March 6, 2026 16:10
@Quntized Quntized had a problem deploying to GitLab GPU trigger March 6, 2026 16:16 — with GitHub Actions Failure
@Quntized Quntized force-pushed the fix/static-tensors-improvement branch 2 times, most recently from e6a2fd2 to 54eabf7 Compare March 6, 2026 16:44
@codecov

codecov Bot commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Quntized Quntized force-pushed the fix/static-tensors-improvement branch from b3f35eb to 1e86e55 Compare March 6, 2026 17:57
@Quntized Quntized force-pushed the fix/static-tensors-improvement branch from 9bed90a to b29dfca Compare March 9, 2026 16:52
Comment thread src/data_types/static_tensors.hpp Outdated
@Quntized Quntized force-pushed the fix/static-tensors-improvement branch from 8f0c7ab to b570382 Compare March 9, 2026 17:37
… fix size()

clang format, recognised, unauthorized character fixed.

space correct
@Quntized Quntized force-pushed the fix/static-tensors-improvement branch from b570382 to 0310308 Compare March 9, 2026 17:51
@EmilyBourne

EmilyBourne commented Mar 9, 2026

Copy link
Copy Markdown
Member

@Quntized Commits are squashed when we merge so it is not important to preserve a clean commit history. By force pushing your changes down to 1 commit all you are doing is:

  • Making it harder for me to see when review comments have been addressed
  • Forcing me to rerun the tests (wasting energy running the same tests multiple times)
  • Delaying the merge of the branch

@Quntized

Quntized commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@EmilyBourne Thanks for the clarification! I didn't realize commits are squashed on merge — I'll just push new commits going forward instead of force-pushing. Sorry for the extra CI runs.

@EmilyBourne

Copy link
Copy Markdown
Member

@tpadioleau @AbdelhadiKara could someone check that this doesn't cause any problems on GPU before I merge please? My WiFi isn't stable enough to use the vpn

@AbdelhadiKara

Copy link
Copy Markdown
Collaborator

@tpadioleau @AbdelhadiKara could someone check that this doesn't cause any problems on GPU before I merge please? My WiFi isn't stable enough to use the vpn

yes,

Comment thread src/data_types/static_tensors.hpp Outdated
Comment thread src/data_types/static_tensors.hpp Outdated
Quntized and others added 2 commits March 10, 2026 16:18
Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
@AbdelhadiKara

Copy link
Copy Markdown
Collaborator

@EmilyBourne, The tests pass on the V100 architecture, only the simulations related to XVx geometry fail, it is not related to this MR I think. (python tkinter issues)

@Quntized

Copy link
Copy Markdown
Contributor Author

@tpadioleau fixed the changes that you suggested and also added in CHANGELOG.md. Let me know if everything looks alright.

@Quntized Quntized had a problem deploying to GitLab GPU trigger March 17, 2026 09:33 — with GitHub Actions Failure

@EmilyBourne EmilyBourne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thomas is on holiday. But I agree that his comments have been addressed. I confirm that the code runs and compiles without warnings on GPU

@EmilyBourne EmilyBourne merged commit ea466c2 into gyselax:devel Mar 17, 2026
25 of 27 checks passed
EmilyBourne pushed a commit that referenced this pull request Mar 18, 2026
… fix Levi-Civita size() #578 (#579)

`src/coord_transformations/static_tensors.hpp`:

1. **Bug fix**: Add missing `enable_tensor_type` specialization for 
   `CartesianLeviCivitaTensor`. 

2. **Bug fix**: Fix `size()` in both `CartesianLeviCivitaTensor` and 
`LeviCivitaTensor`. The previous implementation returned `rank() *
rank()`
    for just  rank = 2; 

3. **Improvement**: Use `ddc::type_seq_element_t<dim, index_set>` for 
   `IdentityTensor::vector_index_set_t`, 

4. **Improvement**: Use `ElementType` instead of hardcoded `double` as
the
   return type of `ddcHelper::get` overloads for special tensors.

5. **Doc fix**: Correct `ddcHelper::get` doc comments 
  "modifiable reference" when the functions return by value.

---------

Co-authored-by: Thomas Padioleau <thomas.padioleau@cea.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants